//
//  BLFriendTrendsTableViewController.m
//  百思不得姐
//
//  Created by hbl on 16/3/14.
//  Copyright © 2016年 hbl. All rights reserved.
//

#import "BLFriendTrendsTableViewController.h"
#import "BLAddFriendViewController.h"
#import "BLLoginViewController.h"

@interface BLFriendTrendsTableViewController ()
- (IBAction)loginBtn:(id)sender;

@end

@implementation BLFriendTrendsTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   // [self setupNav];
    [self setupNav];
    self.view.backgroundColor = BLBg;
}


- (void)setupNav
{
    self.navigationItem.title = @"我的关注";
    UIButton *leftBtn = [self setItemButtonWithImage:@"friendsRecommentIcon" selImage:@"friendsRecommentIcon-click"];
    [leftBtn addTarget:self action:@selector(leftBtnOnClick) forControlEvents:UIControlEventTouchUpInside];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:leftBtn];
}

- (UIButton *)setItemButtonWithImage:(NSString *)image selImage:(NSString *)selImage
{
    UIButton *btn = [[UIButton alloc]init];
    [btn setBackgroundImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:selImage] forState:UIControlStateHighlighted];
    btn.bounds = CGRectMake(0, 0, btn.currentBackgroundImage.size.width, btn.currentBackgroundImage.size.height);
    
    return btn;
}

- (void)leftBtnOnClick
{
    BLAddFriendViewController *addFriend = [[BLAddFriendViewController alloc]init];
    [self.navigationController pushViewController:addFriend animated:YES];
}


- (IBAction)loginBtn:(id)sender {
    BLLoginViewController *login = [[BLLoginViewController alloc]init];
    [self presentViewController:login animated:YES completion:nil];
}
@end
